from django.db import models


# Create your models here.
class AncientPoetry(models.Model):
    title = models.CharField(max_length=255, verbose_name="文章标题", blank=False, default="")
    category = models.CharField(max_length=255, verbose_name="文章分类", blank=True, default="")
    author = models.CharField(max_length=255, verbose_name="作者姓名", blank=True, default="")
    dynasty = models.CharField(max_length=255, verbose_name="作者朝代", blank=True, default="")
    content = models.TextField(verbose_name="文章内容", blank=True, default="")
    translate = models.TextField(verbose_name="文章译文", blank=True, default="")
    appreciation = models.TextField(verbose_name="文章赏析", blank=True, default="")
    notes = models.TextField(verbose_name="文章注释", blank=True, default="")

    class Meta:
        verbose_name = '古诗详情'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.title


class AncientBooks(models.Model):
    title = models.CharField(max_length=255, verbose_name="古籍名称", blank=False)
    introduce = models.TextField(verbose_name="古籍简介", blank=True)
    content = models.TextField(verbose_name="古籍内容", blank=False)
    pic_url = models.CharField(max_length=255, verbose_name="古籍图片名称", blank=True)

    class Meta:
        verbose_name = '古籍详情'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.title
